The present invention generally relates to a method and system for communicating user input wheel movement to a host computing device via a keyboard interface, and more specifically, to encoding wheel movement as key scan codes for input to a host computing device.
The wheel provided as a user control on new types of computer mouse input devices has become a popular feature for scrolling pages on a computer screen, zooming a computer display, throttling speed in a computer game, and other activities. An example of a mouse that has such a wheel is illustrated in Microsoft Corporation""s U.S. Pat. No. 5,473,344, entitled xe2x80x9c3-D Cursor Positioning Device.xe2x80x9d Another example of a popular configuration that enables a mouse wheel to also act as a button is disclosed in Microsoft Corporation""s U.S. Pat. No. 5,912,661, entitled, xe2x80x9cZ-Encoder Mechanism.xe2x80x9d Such mouse input devices monitor wheel movement using sensors having variable resistance potentiometers or optical encoders. Mouse input devices using optical encoders typically employ a light source, such as a light-emitting diode (LED), and one or more light sensors, such as photo transistors. An encoder disk with a number of tabs and spaces arrayed around an outer circumference of the disk is typically disposed between the light source(s) and light sensor(s). The disk is attached to the mouse wheel and rotates about the same axis as the mouse wheel. As the mouse wheel is rotated, the tabs and spaces on the rotating encoder disk respectively interrupt and pass a light beam from the light source(s) to the light sensor(s). With each change between dark and light, output signal(s) from the light sensor(s) change state. A counter coupled to the light sensor(s) counts state changes, producing a count that indicates information such as a position, a direction of rotation, and a rotational speed of the mouse wheel. This numerical information is typically communicated to a host computing device in the form of data packets.
It would be desirable to add a wheel to a computer keyboard to provide the same functions as the mouse wheel, as noted above, so that users can rotate the wheel without moving a hand from the keyboard. However, keyboard interfaces for personal computers (PCs) are based on International Business Machines, Inc.""s Personal System/2 (PS/2) keyboard protocol, which is not intended to communicate a numeric value from a device such as a wheel to a host computer. The PS/2 protocol is designed to communicate the making and breaking of switch contacts that occur each time a key on a keyboard is depressed and released, respectively. Key events are communicated in the form of unique scan codes for each key that is depressed and released. For example, in a first set of scan codes, when the letter xe2x80x9caxe2x80x9d key is depressed, a PS/2 keyboard provides a hexadecimal scan code of xe2x80x9c1E.xe2x80x9d The host computing device recognizes the scan code as representing the letter xe2x80x9ca.xe2x80x9d A table of scan codes and other keyboard specifications applicable to Microsoft WINDOWS(trademark) operating systems is provided in Microsoft Corporation""s Keyboard Scan Code Specification, Revision 13a dated. Mar. 16, 2000, which is available at http://www.microsoft.com/hwdev/desinit/ScanCode.htm#USB. It should be noted that two different sets of scan codes are currently commonly used, and that a third set is less frequently used, but regardless of the set of scan codes that is produced by the keyboard, the making and breaking of keys on the keyboard only produces scan codesxe2x80x94not values that are intended to convey a rotation or direction of a wheel. The PS/2 interface for a keyboard and the operating system software only expects to receive scan codes from a PS/2 keyboard interface. Accordingly, it will be apparent that a method must be developed that enables the movement of a wheel on a keyboard to be encoded using scan codes to enable such a wheel to be incorporated on a keyboard.
Other keyboard communication protocols are currently in use, such as the Universal Serial Bus (USB) protocol. However, the PS/2 protocol remains a widely used and simple communication means that helps keep keyboard manufacturing costs low. Thus, it is desirable to provide a method and system for encoding wheel movement as scan codes that will be readily recognized by a keyboard interface and which can be easily used with existing operating systems.
The present invention is directed to a method to represent movement of a movable element on an input device, with respect to a single axis. The movable element is included on an input device, such as a keyboard, that is adapted to be coupled to a host computing device through a keyboard interface. Movement of the element may be used to control scrolling, zooming, throttling, volume, or other functions of a host computing device. Preferably, the movable element is a wheel, but it may alternatively be a slider or other element whose motion is detected by monitoring state changes with a sensor. A state change reflecting a displacement of the element is detected, and a predefined code indicative of the movement of the element is selected as a function of the state change. Preferably, the predefined code is an unused keyboard scan code, but may alternatively be formatted for input through a USB port, or may employ other forms of switch coding.
In one preferred embodiment, the scan code represents a speed of the movable element, determined as a function of an elapsed time between successive state changes. The elapsed time between state changes is compared to a plurality of threshold times, and the predefined code representing a threshold time determined by the comparison is transmitted to the host computing device.
In another embodiment, the predefined code represents the number of state changes accumulated since the predefined code was last transmitted to the host computing device. The accumulated number of state changes is reduced by a threshold count, and a residual count is then compared to a plurality of threshold counts to determine the next predefined code that is transmitted to the host computing device. This process is repeated until the residual number of state changes is less than a predetermined minimum.
The host computing device is provided with software instructions that enable it to process the predefined code received from the keyboard and change an object displayed as a function of the predefined code. For example, the predefined code can be used to scroll the contents of a window displayed by the host computing device. An acceleration that should be applied to a displayed object can be determined by the host computing device, based upon comparison of successive predefined codes received from the keyboard.
Another aspect of the present invention is directed to a machine-readable medium, disposed in the keyboard, which stores machine-readable instructions that cause the steps of the method described above to be implemented.
Yet another aspect of the present invention is directed to a keyboard that includes a movable element, a state change detector that senses a direction and displacement of the movable element, a memory that stores machine instructions and a plurality of predefined codes, and a processor that communicates with the state change detector and memory and executes the machine instructions. These machine instructions cause the processor to carry out functions that are generally consistent with the steps of the method described above.